<header data-am-widget="header" class="am-header am-header-default sq-head ">
	<div class="am-header-left am-header-nav">
		<a href="javascript:history.back()" class="">
			<i class="am-icon-chevron-left"></i>
		</a>
	</div>
	<h1 class="am-header-title">
		新增收货地址
	</h1>
</header>
<div style="height: 60px;"></div>
<form action="" class="layui-form">
	<ul class="address">
		<li>
			<input type="text" class="city add-input" name="ress_city" readonly placeholder="请选择城市">
		</li>
		<li><input type="text" class="add-input" name="ress_content" value="" placeholder="收货地址"/></li>
		<li><input type="text" class="add-input" name="ress_name" value="" placeholder="收货人"/></li>
		<li><input type="text" class="add-input" name="ress_phone" value="" placeholder="收货人电话"/>
		</li>
	</ul>
	<div class="moren">
		<input type="checkbox" name="checked" value="1" title="设为默认地址" lay-skin="primary" checked>
	</div>
	<button class="login-btn" lay-submit lay-filter="addRess">提交</button>
</form>
<script src="http://www.jq22.com/jquery/jquery-2.1.1.js"></script>
<script src="__STATIC__/city/cityPicker.js"></script>
<script>
    $(".city").CityPicker();
</script>

<script>
    //Demo
    layui.use('form', function () {
        var form = layui.form;
        //监听提交
        form.on('submit(addRess)', function (data) {
            $.post("{:url('index/ReapRess/addRess')}", data.field, function(res) {
                if (res.code==1){
                    layer.alert(res.msg, {icon: 1},function (){
                        location.href=("{:url('index/ReapRess/index')}");
                    });
                }else{
                    layer.msg(res.msg, {icon: 9},function () {});
                }
            });
            return false;
        });
    });
</script>


